gdk: Don't crash when resetting cursor
authorBastien Nocera <hadess@hadess.net>
Thu, 10 May 2012 14:23:57 +0000 (15:23 +0100)
committerBastien Nocera <hadess@hadess.net>
Tue, 15 May 2012 16:49:33 +0000 (17:49 +0100)
When the toplevel is a GdkOffscreenWindow which doesn't
implement the set_device_cursor() vfunc.

https://bugzilla.gnome.org/show_bug.cgi?id=675809

gdk/gdkwindow.c

index 2683073d0993b8ce1ddf580958731ae1b645ad2b..b7e6a13386d9eea7c5f4634594097545c8d5c575 100644 (file)
@@ -7805,7 +7805,8 @@ update_cursor (GdkDisplay *display,
    * which native window has what cursor set. */
   toplevel = get_event_toplevel (pointer_window);
   impl_class = GDK_WINDOW_IMPL_GET_CLASS (toplevel->impl);
-  impl_class->set_device_cursor (toplevel, device, cursor);
+  if (impl_class->set_device_cursor)
+    impl_class->set_device_cursor (toplevel, device, cursor);
 }
 
 static gboolean